package com.znsd.zl.app.user.config;

import com.znsd.zl.app.user.interceptor.AppUserLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * <p>
 *      mvc自定义配置
 * </p>
 *
 * @ClassName MvcConfig
 * @Description 配置拦截器
 * @Author jaypdd
 * @Date 2020/8/26 17:09
 * @Version v1.0
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

	@Resource
	private AppUserLoginInterceptor appUserLoginInterceptor;

	/**
	 * 注册用户是否登录校验拦截器
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(appUserLoginInterceptor);
	}
}
